package com.study.hot.jetpack.demo_shopping.viewmodel.factory

import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.study.hot.jetpack.demo_shopping.viewmodel.ProductModel

/**
 * <pre>
 *     author : fauks
 *     time   : 2020/03/27
 *     desc   :
 * </pre>
 */
class ProductModelFactory(val grade: Int) : ViewModelProvider.NewInstanceFactory() {
    override fun <T : ViewModel?> create(modelClass: Class<T>): T {
        return ProductModel(grade) as T
    }
}